package com.bw.common.adapter

import android.widget.ImageView
import androidx.databinding.BindingAdapter
import com.bw.image.GlideImageLoader

object CommonBindingAdapter {

    @JvmStatic
    @BindingAdapter("loadResImage")
    fun loadResImage(iv: ImageView,resId:Int){
        if(resId!=0){
         GlideImageLoader.loadResImage(iv.context,resId,iv)
        }
    }


    @JvmStatic
    @BindingAdapter("loadUrlImage")
    fun loadUrlImage(iv: ImageView,url:String){
        if(url.isNotEmpty()){
            GlideImageLoader.loadImage(iv.context,url,iv)
        }
    }

}